<?php
defined('OA_LIB_PATH') || define('OA_LIB_PATH', '/opt/op/OALib');

require_once 'PHPUnit/Framework.php';
require_once 'Log.php';
require_once OA_LIB_PATH . '/inner/open/models/OaAuditLogHisModel.php';

class OaAuditLogHisModelTest extends PHPUnit_Framework_TestCase
{
    private $_logger;
    private $_model;
    
    protected function setUp()
    {
        $logger = Log::factory('console');
        $logger->setMask(Log::MAX(PEAR_LOG_DEBUG));
        $this->_logger = $logger;
        $this->_model = new OaAuditLogHisModel($logger);
    }
    
    protected function tearDown()
    {
        
    }
    
    public function testGetRegLoginDataByArea()
    {
//        $this->markTestSkipped();
        $result = $this->_model->getServiceInfo('2009-01-01', '2010-04-26');
        $this->_logger->log($result, PEAR_LOG_DEBUG);
        $this->assertTrue(is_array($result));
//        $result = $this->_model->getAuditLog('2009-01-01', '2010-04-26', array(50493, 50490, 50601), 0, 5);
//        $this->_logger->log($result, PEAR_LOG_DEBUG);
//        print_r($result);
        $this->assertTrue($result !== false);
        $result = $this->_model->getAuditLogCount('2009-01-01', '2010-04-26', array(50493, 50490, 50601));
        $this->_logger->log($result, PEAR_LOG_DEBUG);
        $this->assertTrue($result !== false);
    }
}